package com.curry.apiprovider.crawler.pageProcessor.job;

import com.curry.apiprovider.crawler.pageProcessor.MyPipLine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;

import java.util.Map;
import java.util.Set;

public class JobPipLine extends MyPipLine {

    private Logger logger = LoggerFactory.getLogger(MyPipLine.class);

    @Override
    public void process(ResultItems resultItems, Task task) {
        Map<String, Object> resultItemsAll = resultItems.getAll();
        Set<String> strings = resultItemsAll.keySet();
        String keyType = getKeyType();
        String jsonData = resultItems.get(keyType);
        super.data = jsonData;
    }
}
